import React, { Component } from 'react';
import { InputItem } from 'antd-mobile'
import _ from 'lodash'
import { withRouter } from 'react-router-dom'
import { SearchBox } from './style'

@withRouter
class Search extends Component {
  constructor(props) {
    super(props);
    this.nowSearch = _.throttle(this.nowSearch, 1000)
  }
  nowSearch = e => {

  }
  render() {
    return (
      <div>
        <InputItem clear placeholder="输入要搜索的关键词" ref={el => this.kw = el} onChange={this.nowSearch}
        >
          <span onClick={() => {
            this.props.history.push('/')
          }}>取消</span>
        </InputItem>
        <SearchBox>
          <div>
            <div className="hot">
              <h4>
                热门搜索
              </h4>
              <ul>
                <li><div>律师入门</div></li>
                <li><div>并购重组</div></li>
                <li><div>IPO</div></li>
                <li><div>税务基础</div></li>
                <li><div>资产证券化</div></li>
                <li><div>新三版</div></li>
                <li><div>律师行</div></li>
              </ul>
            </div>
            <div className="hot">
              <h4>
                历史搜索<span>清除</span>
              </h4>
              <ul>
                <li><div>律师入门</div></li>
                <li><div>iPhone X</div></li>
                <li><div>IPO</div></li>
                <li><div>公司重组</div></li>
                <li><div>基小率团队</div></li>
                <li><div>新三版</div></li>
                <li><div>律师行</div></li>
              </ul>
            </div>
          </div>
        </SearchBox>
      </div>

    );
  }
}

export default Search;
